package org.sage.sdk.dada.order.entity;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.sage.sdk.dada.infrastructure.common.attributes.Callback;
import org.sage.sdk.dada.infrastructure.common.attributes.CityCode;
import org.sage.sdk.dada.infrastructure.common.attributes.IsPrepay;
import org.sage.sdk.dada.infrastructure.common.attributes.ShopNo;
import org.sage.sdk.dada.infrastructure.utils.GetBodyUtil;
import org.sage.sdk.dada.order.aggregate.Cargo;
import org.sage.sdk.dada.order.aggregate.Order;
import org.sage.sdk.dada.order.aggregate.Origin;
import org.sage.sdk.dada.order.aggregate.Receiver;

/**
 * 新增配送单
 * <p>
 * (1) 接口调用URL地址：/api/order/addOrder。
 * (2) 在测试环境，使用统一商户和门店进行发单。其中，商户id：73753，门店编号：11047059。
 *
 * @author 周广明
 * @version v1 2019/12/10 下午4:47
 */
@NoArgsConstructor
public class AddOrder extends Order {

    @Override
    public String getUrl() {
        return "/api/order/addOrder";
    }

    @Override
    public String getBody() {
        return GetBodyUtil.toJsonStr(this);
    }

    public AddOrder(ShopNo shopNo, Origin origin, CityCode cityCode, Cargo cargo,
                    IsPrepay isPrepay, Receiver receiver, Callback callback) {
        super(shopNo, origin, cityCode, cargo, isPrepay, receiver, callback);
    }
}
